<!doctype html>
<html>
	<head>
		
		<meta name="layout" content="kickstart"/>
		<title>Mr-Rights|Gestione Pratica</title>
		<script src="${resource(dir: 'site/js/plugin/bootstrap-wizard', file: 'jquery.bootstrap.wizard.min.js')}"></script>
		<script src="${resource(dir: 'site/js/plugin/fuelux/wizard', file: 'wizard.min.js')}"></script>
		<link rel="stylesheet" href="${resource(dir: 'css', file: 'Interview.css')}"/>
		<script language="JavaScript">
<%--		var allertView=true;--%>
<%--		  window.onbeforeunload =function ()--%>
<%--				  {--%>
<%--			  <exdutility:isReadOnly test="false">--%>
<%--			  		if(allertView){--%>
<%--			  			return "Stai per uscire dall'intervista !Se non hai salvato perderai tutte le tue modifiche!";--%>
<%--				  		}else{--%>
<%--				  			allertView=true;--%>
<%--					  	}--%>
<%--			  </exdutility:isReadOnly>		  --%>
<%--				  }--%>
		</script>
		
		<script type="text/javascript">
		$(document).ready(function(){
			<exdutility:isReadOnly test="false">
			$("a").on('click',function(event){
				var href=this.href;
				if(href.indexOf('interview/pages')== -1){
					if(this.getAttribute("data-action")=="toggleShortcut" && href==""){
						showShortCut();
					}else{
						showSaveStep(this);
					}	
					return false;
				}
			});
			</exdutility:isReadOnly>
		});
		
		function showSaveStep(link){
			
			$.SmartMessageBox({
				title : "<div class='row'><div class='col-md-2'><i class='fa '></i></div><div class='col-md-10'>Stai per uscire dall'intervista !</div>",
				content : "<div class='col-md-2'></div><div class='col-md-10'> Vuoi salvare le modifiche?<BR/><BR/></div></div>",
				buttons:"[Rimani su questa intervista][No],[Si],",
				sound:false
			}, function(ButtonPressed, Value) {
				if (ButtonPressed === "Rimani su questa intervista") {
					shortcut_dropdown.animate({height:"hide"},300,"easeOutCirc"),$.root_.removeClass("shortcut-on");
				}
				if (ButtonPressed === "No") {
					if(link){
					if(link.href){
						location.href=link.href
						allertView=false;
					}else{
						
					}
				}
					return true;	
				}
				if (ButtonPressed === "Si") {
					var $valid = $("#interview").valid();
					if ($valid) {
						if(link){
						if(link.href){
							location.href=link.href
							$('input[name=toPageSix]').click();
							allertView=false;
						}
						}
					}
					return true;	 
				}
					
				});
			
			}

		function showShortCut(){
<%--			$("#shortcut").animate({height:"hide"},300,"easeOutCirc");--%>

			shortcut_dropdown.animate({height:"show"},200,"easeOutCirc"),$.root_.addClass("shortcut-on")
			}
		</script>
	</head>
<body >
<!-- RIBBON Macro Categori-->
			<div id="ribbon">

<%--				<span class="ribbon-button-alignment"> --%>
<%--					<span id="refresh" class="btn btn-ribbon" data-action="resetWidgets" data-title="refresh" rel="tooltip" data-placement="bottom" data-original-title="<i class='text-warning fa fa-warning'></i> Warning! This will reset all your widget settings." data-html="true">--%>
<%--						<i class="fa fa-refresh"></i>--%>
<%--					</span> --%>
<%--				</span>--%>
				
				<!-- breadcrumb -->
<%--				<ol class="breadcrumb">--%>
<%--					<li>Intervista</li>--%>
<%--				</ol>--%>
				<!-- end breadcrumb -->

				<!-- You can also add more buttons to the
				ribbon for further usability

				Example below:

				<span class="ribbon-button-alignment pull-right">
				<span id="search" class="btn btn-ribbon hidden-xs" data-title="search"><i class="fa-grid"></i> Change Grid</span>
				<span id="add" class="btn btn-ribbon hidden-xs" data-title="add"><i class="fa-plus"></i> Add</span>
				<span id="search" class="btn btn-ribbon" data-title="search"><i class="fa-search"></i> <span class="hidden-mobile">Search</span></span>
				</span> -->

			</div>
			<!-- END RIBBON -->
			
			<!-- MAIN CONTENT -->
			<div id="content">
				<div class="row col-lg-12">
				
				<g:render template="common/ajaxflow"/>
				
				
				</div>
			</div>
</body>
</HTML>			
